<?php

defined('BASEPATH') or die('No direct script access allowed');

/**
 * 任务模型
 * @author  Karson
 * @name    task.php
 * @since   2012-12-13 23:06:46
 */
class Task_Model extends Model {

    function _init() {
        
    }

    //读取会员相关的分类
    function get_user_task_list($user_id = null) {
        $user_id = !is_null($user_id) ? $user_id : $this->auth->user_id;
        $this->db->query("SELECT * FROM {pre}task WHERE user_id='{$user_id}' ORDER BY id DESC");
        $usertask = array();
        while ($row = $this->db->get_array()) {
            $usertask[$row['id']] = $row;
        }
        return $usertask;
    }

}